﻿using FluentValidation;
using RockBus.DataContracts;

namespace RockBus.ConfigurationService.Validation
{
    public class AddOrUpdateSubscribersRequestValidator : AbstractValidator<AddOrUpdateSubscribersRequest>
    {
        public AddOrUpdateSubscribersRequestValidator()
            : base()
        {
            this.RuleFor(x => x.Subscribers).NotNull();
            this.RuleFor(x => x.Subscribers).NotEmpty();
            this.RuleFor(x => x.Subscribers).SetCollectionValidator(new SubscriberInfoValidator());
        }
    }
}